package aom.ju.ss.view.user.userOrder

import android.view.View
import aom.ju.ss.R
import aom.ju.ss.databinding.RequestRefundBinding
import aom.ju.ss.lpInterface.TitleDialogInterface
import aom.ju.ss.mode.TuikuangoodsInfo
import aom.ju.ss.utils.callPhone
import aom.ju.ss.utils.data
import aom.ju.ss.view.base.BaseActivity
import aom.ju.ss.view.dialog.TitleDialog
import com.google.gson.Gson

/**
 * 退款类型
 */
class RequestARefund : BaseActivity() {
    lateinit var info: TuikuangoodsInfo
    private lateinit var binding: RequestRefundBinding
    // 1申请退款（未发货）  2退款退货（已发货）  3仅退款（已发货）

    //4006875658
    override fun init() {
        binding = viewBinding as RequestRefundBinding
        info = Gson().fromJson(data, TuikuangoodsInfo::class.java)
        binding.info = info
//        start(RequestARefundActivity::class.java, "2")
        binding.thtk.setOnClickListener {
            TitleDialog().show(activity, object : TitleDialogInterface {
                override fun ok(view: View?, IsDetermine: Boolean) {
                    if (IsDetermine) {
                        callPhone(activity!!, "4006875658")
                    }

                }
            }).setConnect("是否拨打客服电话?400-687-5658")
                .tvDetermine("拨打")
                .tvCancel("取消")
        }
        binding.tk.setOnClickListener { binding.thtk.performClick() }
        binding.hh.setOnClickListener { binding.thtk.performClick() }
        binding.tj.setOnClickListener { binding.thtk.performClick() }

    }

    override val lay: Int = R.layout.request_refund
}